<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link href="__PUBLIC__/css/admin/module.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/css/admin/module.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table>
    <thead>
        <tr class="th">
            <th width="120" align="center"><?php echo LANG('modulename')?></th>
            <th width='220' align="center"><?php echo LANG('modulepath')?></th>
            <th width="100" align="center"><?php echo LANG('versions')?></th>
            <th width='300' align="center"><?php echo LANG('installdate')?></th>
            <th width="300" align="center"><?php echo LANG('updatetime')?></th>
            <th width="100" align="center"><?php echo LANG('operations_manage')?></th>
        </tr>
    </thead>
    <tbody>
        <?php
            if(is_array($module_list)) {
                foreach ($module_list as $d) {
                    $module = gt_base::load_model('Module')->query_module($d);
                    if($module) {


                        ?>
                        <tr class="module">
                            <td width="120" align="center"><?php echo $module['name']?></td>
                            <td width="100" align="center"><?php echo $d?></td>
                            <td width="100" align="center"><?php echo $module['version']?></td>
                            <td width="300" align="center"><?php echo $module['install_date']?></td>
                            <td width="300" align="center"><?php echo $module['update_date']?></td>
                            <td align="center">
                                <?php if ($module['iscore']) {?><span style="color: #999"><?php echo LANG('ban')?></span><?php } else {?><a href="javascript:void(0);" onclick="if(confirm('<?php echo LANG('confirm', array('message'=>$modules[$d]['name']))?>')){uninstall('__URL__/uninstall?module=<?php echo  $module['module']?>');return false;}"<font color="#ff0000"><?php echo LANG('uninstall')?></font></a><?php }?>
                            </td>
                        </tr>
                    <?php
                    }else{
                        $moduel = $isinstall = $modulename = '';
                        if (file_exists(APP_BASE.'Application'.DIRECTORY_SEPARATOR.$d.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php')) {
                            require APP_BASE.'Application'.DIRECTORY_SEPARATOR.$d.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php';
                            $isinstall = LANG('install');
                        } else {
                            $module = LANG('unknown');
                            $isinstall = LANG('no_install');
                        }
                        ?>
                        <tr class="module bg-install">
                            <td align="center" width="220"><?php echo $modulename?></td>
                            <td width="220" align="center"><?php echo $d?></td>
                            <td align="center"><?php echo $version?></td>
                            <td width="200" align="center"><?php echo $installdate?></td>
                            <td width="200" align="center"><?php echo $updatedate?></td>
                            <td align="center">
                                <a href="javascript:install('__URL__/install?module=<?php echo $d?>');"><font color="#009933"><?php echo LANG('install')?></font></a>
                            </td>
                        </tr>
                        <?php
                    }
                }
            }
        ?>
    </tbody>
</table>
<script src='__PUBLIC__/assets/js/jquery.js'></script>
<script src="__PUBLIC__/assets/js/bootstrap.js"></script>
<script src="__PUBLIC__/assets/js/ace/ace.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">

    function install(url) {
        open_dialog(url);
    }

    function uninstall(url) {
        open_dialog(url);
    }

    //-->
</script>
</body>
</html>